{/include file="simpla/common/header.html"/}
{/include file="simpla/common/left.html"/}
<div id="main-content">
  <h2>欢迎您 {/$_adminname/}</h2>
  <p id="page-intro">商品入库。带<font class="red"> * </font>为必填</p>
  <div class="clear"></div>
  <div class="content-box">
    <div class="content-box-header">
      <h3>商品入库</h3>
      <ul class="content-box-tabs">
        <li><a href="{/get_url rule="/purchase/index"/}">库存情况</a></li>
        <li><a href="#tab1" class="default-tab">添加库存</a></li>
      </ul>
      <div class="clear"></div>
    </div>
    <div class="content-box-content">
      <div class="tab-content default-tab" id="tab1">
        <div class="form">
          <form action="{/get_url rule='/purchase/purchase' data="ac=$ac"/}" method="post" id="js-form">
            <fieldset class="clearfix">
            <input type="hidden" name="goods_id" value="{/$goods.goods_id/}" />
                  {/if $goods.goods_name/}<p><label>商品名称：{/$goods.goods_name/}</label></p>{//if/}
                  <p><label class="w80"><font class="red"> * </font>数量：</label>
                    <input type="text" value="" class="text-input min-input" name="in_num" id="in_num" /><span></span><br /><small>记重商品单位为千克</small>
                    </p>
                  <p><label class="w80"><font class="red"> * </font>进价：</label>
                    <span><input type="text" value="{/$goods.in_price/}" class="text-input min-input" name="in_price" id="in_price" />元</span>
                    </p>
                  <p><label class="w80"><font class="red"> * </font>选择仓库：</label>
                    <span><input type="text" value="{/$goods.store_id/}" class="text-input min-input" name="store_id" id="store_id" /></span>
                    </p>
                  <p><label><font class="red"> * </font>商品条形码：</label>
                    <input type="text" value="{/$goods.goods_sn/}" class="text-input small-input" name="goods_sn" id="goods_sn" /><span><a href="#ProBox" style="margin-left:5px;" id="selectPro">手动选择</a></span>
                    </p>
              <dt>
                <input type="submit" name="" class="button" id="button" value="入库" />
              </dt>
            </fieldset>
          </form>
        </div>
      </div>
    </div>
  </div>
  <div style="display:none;">
    <div id="ProBox" class="sBox" >
      <h2>选择商品</h2>
      <ul id="prolist">
        <li rel="">全部</li>
        {/section name=i loop=$catelist/}
        <li rel="{/$catelist[i].cat_id/}">{/$catelist[i].pre/}{/$catelist[i].cat_name/}</li>
        {//section/}
      </ul>
      <div id="Prolists"> </div>
      <div class="clear"></div>
    </div>
  </div>
  <link rel="stylesheet" href="{/$root_dir/}/assets/js/jquery.colorbox/css/colorbox.css" type="text/css" />
  <script type="text/javascript" src="{/$root_dir/}/assets/js/jquery.colorbox/jquery.colorbox-min.js"></script> 
  <script>
$('#selectPro').colorbox({
    inline: true,
    width: "60%",
    height: "80%",
    onComplete: function() {
        $('#Prolists').width($('#ProBox').width() - 165);
    }
});
$('#selectCard').click();
$('#Prolists .pagination a').live('click',
function() {
    $.get($(this).attr('href') + '?t=' + Math.random(),
    function(data) {
        $('#Prolists').html(data);
    });
    return false;
});
$('#Prolists .sn').live('click',
function() {
    $('#goods_sn').val($(this).attr('rel'));
    $.colorbox.close();
});

$('#prolist li').click(function() {
    var self = $(this);
    var v = self.attr('rel');
    $.post("{/get_url rule='/goods/ajaxgoods'/}", {
        cat_id: v
    },
    function(data) {
        $('#Prolists').html(data);
    });
});
</script> 

  {/include file="simpla/common/copy.html"/} </div>
{/include file="simpla/common/footer.html"/}